#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import subprocess

# 专业执行系统命令
# subprocess.getoutput(命令) 返回命令执行的结果
# subprocess.run(命令)  返回CompletedProcess对象
# subprocess.check_call(命令) 返回状态码
# \r\n windows的换回符
# \n Linux的换行符

try:
    with open("cmd.txt", 'r', encoding="utf-8") as f:
        for c in f.readlines():
            res = subprocess.getoutput(c)
            print(res)
except Exception as e:
    print(e)
